<#import "../tpl/pageTep.ftl" as page>
<@page.pageBase currentMenu="首页通知">
<div class="xm-offline">
    <div class="row">
        <div class="panel">
            <div class="panel-body">
                <form id="editForm" class="form-horizontal" action="${basepath}/manage/systemSetting/updateNoticeJson"
                      method="post">
                    <input type="hidden" class="control-text span-width span10" name="id" value="1">
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            通知内容：
                        </label>
                        <div class="controls">
                            <input type="text" class="control-text span-width span12" name="noticeContent"
                                   value="" id="content-btn"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            通知链接：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span12" name="noticeLink"
                                   value="" id="link-btn"/>
                        </div>
                    </div>
                    <div class="centered">
                        <button type="submit" class="button  button-large  button-success">重新发布</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script>
    setTimeout(function () {
        var editForm = new BUI.Form.Form({
            srcNode: '#editForm',
            submitType: 'ajax',
            callback: function (data) {
                if (data.success == true) {
                    window.location.href = "${basepath}/manage/news/toNotice"
                } else {

                }
            }
        }).render();
    }, 1000);
    $.ajax({
        type: "GET",
        url: "/manage/systemSetting/selectDetail",
        dataType: "json",
        success: function (data) {
            if(data)
           $("#link-btn").val(data.data.noticeLink);
            $("#content-btn").val(data.data.noticeContent);
        }
    });

</script>

</@page.pageBase>